package com.example.enjoyarkuix.base;

import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

import com.example.enjoyarkuix.R;

public class BaseActivity extends AppCompatActivity {

    private TextView mTvTopBarTitle;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }
    protected void initTopBar(String title) {
        ImageView ivTopBarBack= (ImageView) findViewById(R.id.ivTopBarBack);
        ivTopBarBack.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                finish();
            }
        });
        mTvTopBarTitle = (TextView) findViewById(R.id.tvTopBarTitle);
        setTvTopBarTitle(title);
    }
    protected void setTvTopBarTitle(String title)
    {
        if (mTvTopBarTitle!=null)
        {
            mTvTopBarTitle.setText(title+"   原生Activity");
        }
    }
}
